package com.itany.shop.service;

import com.itany.shop.entity.Order;
import com.itany.shop.entity.User;
import com.itany.shop.exception.LoginDisabledException;
import com.itany.shop.exception.RequestParameterErrorException;
import com.itany.shop.vo.Cart;

import java.util.List;

/**
 * @Author:石小俊
 * @Date: 2022/12/21 9:11
 * @Version:1.0-SNAPSHOT
 * @Description:
 */
public interface OrderService {

    /**
     * 生成订单,返回订单号
     * 订单号规则:随机四位英文字母或者下划线+毫秒数
     * @param cart
     * @param user
     * @return
     */
    public String createOrder(Cart cart, User user) throws LoginDisabledException;

    /**
     * 查询我的订单
     * @param user
     * @return
     */
    public List<Order> findMyOrders(User user) throws LoginDisabledException;

    /**
     * 查询指定订单的详情信息
     * @param id
     * @return
     */
    public Order findDetail(String id) throws RequestParameterErrorException;
}
